<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../include/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>主模板表单页面</title>
<%@ include file="../include/easyui.jsp"%>
</head>
<body>
<div>
	<form id="mainform" action="${ctx}/import/mainExcelTemplate/${action}" method="post">
	<table  class="formTable">
		<tr>
			<td>主模板名：</td>
			<td>
			<c:if test="${action == 'update'}">
				<input type="hidden" name="id" value="${id }" />
			</c:if>
			<input id="name" name="name" type="text" value="${mainExcelTemplate.name }" class="easyui-validatebox"  data-options="width: 150,required:'required'"/>
			</td>
		</tr>
		<tr>
			<td>编码：</td>
			<td>
				<input id="code" name="code" type="text" value="${mainExcelTemplate.code }" class="easyui-validatebox"  data-options="width: 150,required:'required'"/>
			</td>
		</tr>
		<tr>
			<td>开始行数：</td>
			<td><input id="startLine" name="startLine" type="text" value="${mainExcelTemplate.startLine}" class="easyui-numberbox" data-options="width: 150,required:'required'" /></td>
		</tr>
		<tr>
			<td>表名称：</td>
			<td>
				<input id="tableName" name="tableName" type="text" value="${mainExcelTemplate.tableName }" class="easyui-validatebox"  data-options="width: 150,required:'required'"/>
			</td>
		</tr>
		<tr>
			<td>排序：</td>
			<td><input id="sort" name="sort" type="text" value="${mainExcelTemplate.sort}" class="easyui-numberbox" data-options="width: 150" /></td>
		</tr>
		<tr>
			<td>是否有效：</td>
			<td>
				<select id="enable" name="enable"  class="easyui-combobox" data-options="width:140,height:29,editable:false,panelHeight:'auto'">
					<option value="0" <c:if test="${mainExcelTemplate.enable == false}">selected</c:if>>有效</option>
					<option value="1" <c:if test="${mainExcelTemplate.enable == true}">selected</c:if>>无效</option>
				</select>
			</td>
		</tr>
	</table>
	</form>
</div>

<script type="text/javascript">
var action="${action}";

$(function(){
	$('#mainform').form({    
	    onSubmit: function(){    
	    	var isValid = $(this).form('validate');
			return isValid;	// 返回false终止表单提交
	    },    
	    success:function(data){
			var data = eval('(' + data + ')');
	    	successTip(data.message,dg,dialog);
	    }    
	}); 
});
</script>

</body>
</html>